EventQuery Object

The EventQuery object is used to setup and execute event filtering queries for the AUD, ELS, and ELSALM services. The query accepts user-defined parameters and filters, and returns information for the filtered events in XML format.

Within the calling script, the basic sequence of operations is as follows:

The main query is defined by start and end times and a periodic run interval. Separate XML string filters can be defined for the Audit, ELS, and ELSALM services. A string of site services, separated by semicolons, can be defined for each of the service filters. The simplest example of a query would include start and end times, a service definition in the form Site.Service, and a blank filter string. The blank filter would be totally non-restrictive within the scope of the time window and service definition.

The query object works as an asynchronous thread so that a query can be initiated at one time, and the results obtained at a later time. Once the object starts the query engine, it will run continuously until the calling script cancels the filtering. The periodic update interval defines the interval at which the query engine will execute the search for new events. However, if the calling script specifies an update interval of zero, the specified queries will search for events only once.

The calling script can define a CVS tag which will contain a notification of when the queries have completed. This notification point can be used to trigger a script to process results. Resetting the notification point value is not handled by the automation object; it is the responsibility of the calling script. Alternatively, the calling script can ask the automation object directly whether the query is complete.

Once the query is complete, the automation object can be polled for results. You can retrieve results for the number of events found for each of the three service filters or retrieve a list of services (Site.Service) and database keys (dbKeys) matching the query. You can then individually retrieve complete event information in XML format, using the service and key information.

The object is declared using the following code:

CreateObject("CxEventIf.EventQuery")

Each documented method will assume you have declared the EventQuery object using the following code:

Dim EventQuery

Set EventQuery = CreateObject("CxEventIf.EventQuery")


More: